package com.itheima.case2.service;

import com.itheima.case2.dao.RoleDao;
import com.itheima.case2.pojo.po.Role;
import com.itheima.case2.utils.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class RoleServiceImpl  implements RoleService{

    public List<Role> findRoleList() {

        SqlSession sqlSession = SqlSessionUtil.getSession();
        RoleDao roleDao = sqlSession.getMapper(RoleDao.class);

        // 查询全部角色数据
        List<Role> roleList = roleDao.findRoleList();

        return roleList;
    }
}
